home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / glfrustum.z / glfrustum
Encoding:
Text File  |  2002-10-03  |  7.6 KB  |  163 lines

  1.  
  2.  
  3.  
  4. ggggllllFFFFrrrruuuussssttttuuuummmm((((3333GGGG))))                  OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                  ggggllllFFFFrrrruuuussssttttuuuummmm((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ggggllllFFFFrrrruuuussssttttuuuummmm - multiply the current matrix by a perspective matrix
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      void ggggllllFFFFrrrruuuussssttttuuuummmm( GLdouble _l_e_f_t,
  14.                      GLdouble _r_i_g_h_t,
  15.                      GLdouble _b_o_t_t_o_m,
  16.                      GLdouble _t_o_p,
  17.                      GLdouble _n_e_a_r,
  18.                      GLdouble _f_a_r )
  19.  
  20.  
  21. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  22.      _l_e_f_t, _r_i_g_h_t Specify the coordinates for the left and right vertical
  23.                  clipping planes.
  24.  
  25.      _b_o_t_t_o_m, _t_o_p Specify the coordinates for the bottom and top horizontal
  26.                  clipping planes.
  27.  
  28.      _n_e_a_r, _f_a_r   Specify the distances to the near and far depth clipping
  29.                  planes.  Both distances must be positive.
  30.  
  31. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.      ggggllllFFFFrrrruuuussssttttuuuummmm describes a perspective matrix that produces a perspective
  33.      projection.  The current matrix (see ggggllllMMMMaaaattttrrrriiiixxxxMMMMooooddddeeee) is multiplied by this
  34.      matrix and the result replaces the current matrix, as if ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx
  35.      were called with the following matrix as its argument:
  36.  
  37.  
  38.  
  39.  
  40.  
  41.                   |                                             |
  42.  
  43.                   |                                             |
  44.  
  45.                   |                                             |
  46.  
  47.                   |                2 near____________                             |
  48.                                                 0         A        0
  49.                   |          right - left                             |
  50.  
  51.                   |                                             |
  52.                                                 2 near____________
  53.                   |          0                        B        0   |
  54.                                            top - bottom
  55.                   |                                             |
  56.  
  57.                   |          0               0          C        D   |
  58.  
  59.                   |                                            |
  60.                            0              0        -1       0
  61.  
  62.  
  63.                                                  right + left____________
  64.                                  A =
  65.                                      right - left
  66.  
  67.  
  68.                                                  top + bottom____________
  69.                                  B =
  70.                                      top - bottom
  71.  
  72.  
  73.                                                  far + near__________
  74.                                   C = -
  75.                                        far - near
  76.  
  77.  
  78.                                                  2 far near__________
  79.                                   D = -
  80.                                        far - near
  81.  
  82.  
  83.      Typically, the matrix mode is GGGGLLLL____PPPPRRRROOOOJJJJEEEECCCCTTTTIIIIOOOONNNN, and (_l_e_f_t, _b_o_t_t_o_m, -_n_e_a_r)
  84.      and (_r_i_g_h_t, _t_o_p,  -_n_e_a_r) specify the points on the near clipping plane
  85.      that are mapped to the lower left and upper right corners of the window,
  86.  
  87.  
  88.  
  89.                                                                         PPPPaaaaggggeeee 1111
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. ggggllllFFFFrrrruuuussssttttuuuummmm((((3333GGGG))))                  OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                  ggggllllFFFFrrrruuuussssttttuuuummmm((((3333GGGG))))
  97.  
  98.  
  99.  
  100.      assuming that the eye is located at (0, 0, 0).  -_f_a_r specifies the
  101.      location of the far clipping plane.  Both _n_e_a_r and _f_a_r must be positive.
  102.  
  103.      Use ggggllllPPPPuuuusssshhhhMMMMaaaattttrrrriiiixxxx and ggggllllPPPPooooppppMMMMaaaattttrrrriiiixxxx to save and restore the current matrix
  104.      stack.
  105.  
  106. NNNNOOOOTTTTEEEESSSS
  107.      Depth buffer precision is affected by the values specified for _n_e_a_r and
  108.      _f_a_r.  The greater the ratio of _f_a_r to _n_e_a_r is, the less effective the
  109.      depth buffer will be at distinguishing between surfaces that are near
  110.      each other.  If
  111.  
  112.                                              far____
  113.                                      r =
  114.                                          near
  115.  
  116.  
  117.      roughly log (r) bits of depth buffer precision are lost.  Because r
  118.                 2
  119.      approaches infinity as _n_e_a_r approaches 0, _n_e_a_r must never be set to 0.
  120.  
  121. EEEERRRRRRRROOOORRRRSSSS
  122.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____VVVVAAAALLLLUUUUEEEE is generated if _n_e_a_r or _f_a_r is not positive, or if _l_e_f_t
  123.      = _r_i_g_h_t, or _b_o_t_t_o_m = _t_o_p.
  124.  
  125.      GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ggggllllFFFFrrrruuuussssttttuuuummmm is executed between the
  126.      execution of ggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ggggllllEEEEnnnndddd.
  127.  
  128. AAAASSSSSSSSOOOOCCCCIIIIAAAATTTTEEEEDDDD GGGGEEEETTTTSSSS
  129.      ggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMAAAATTTTRRRRIIIIXXXX____MMMMOOOODDDDEEEE
  130.      ggggllllGGGGeeeetttt with argument GGGGLLLL____MMMMOOOODDDDEEEELLLLVVVVIIIIEEEEWWWW____MMMMAAAATTTTRRRRIIIIXXXX
  131.      ggggllllGGGGeeeetttt with argument GGGGLLLL____PPPPRRRROOOOJJJJEEEECCCCTTTTIIIIOOOONNNN____MMMMAAAATTTTRRRRIIIIXXXX
  132.      ggggllllGGGGeeeetttt with argument GGGGLLLL____TTTTEEEEXXXXTTTTUUUURRRREEEE____MMMMAAAATTTTRRRRIIIIXXXX
  133.      ggggllllGGGGeeeetttt with argument GGGGLLLL____CCCCOOOOLLLLOOOORRRR____MMMMAAAATTTTRRRRIIIIXXXX
  134.  
  135.  
  136. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  137.      ggggllllOOOOrrrrtttthhhhoooo, ggggllllMMMMaaaattttrrrriiiixxxxMMMMooooddddeeee, ggggllllMMMMuuuullllttttMMMMaaaattttrrrriiiixxxx, ggggllllPPPPuuuusssshhhhMMMMaaaattttrrrriiiixxxx, ggggllllVVVViiiieeeewwwwppppoooorrrrtttt
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.                                                                         PPPPaaaaggggeeee 2222
  160.  
  161.  
  162.  
  163.